package com.bw.mallshop.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bw.mallshop.R;
import com.bw.mallshop.entity.SecKillEntity;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;

public class SkillAdapter extends BaseQuickAdapter<SecKillEntity.Value, BaseViewHolder> {

    public SkillAdapter() {
        super(R.layout.item_seckill);
        addChildClickViewIds(R.id.seckill_add_tv);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, SecKillEntity.Value value) {
        ImageView imageView = baseViewHolder.getView(R.id.seckill_item_img);
        Glide.with(imageView.getContext()).load(value.goods_default_icon).centerCrop()
                .into(imageView);
        baseViewHolder.setText(R.id.seckill_item_dec,value.goods_desc);
        baseViewHolder.setText(R.id.seckill_item_title,value.goods_default_sku);
        baseViewHolder.setText(R.id.seckill_item_price,value.goods_default_price);
    }
}
